﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;

namespace PloobsEngine.SceneControl
{
    public class ToneMappingPostEffect : IPostEffect
    {
        public ToneMappingPostEffect(float luminance)
        {
            this.luminance = luminance;
        }

        private float luminance;

        Effect effect = null;        
        public void Draw(IRenderHelper rHelper, Microsoft.Xna.Framework.GameTime gt, Microsoft.Xna.Framework.Rectangle screenRec, IWorld world)
        {
            effect.Parameters["Luminance"].SetValue(luminance);
            rHelper.RenderTextureToFullScreenSpriteBatch(PrincipalConstants.CurrentImage, effect);
        }

        public void init(EngineStuff engine)
        {
            effect = EngineStuff.InternalContentManager.GetAsset<Effect>("ToneMapping");            
        }

    }
}
